package com.product.android.commonInterface.contact;

import java.io.Serializable;

import org.json.JSONObject;

import com.common.android.utils.JSONUtils;


public class TagInfo  implements Serializable{
	
	private static final long serialVersionUID = -6919537623845751990L;
	private long uid;
	private int tagid;
	private String tagname;
	private String groupname;
	
	
	public void setJsonObject(JSONObject json){
		this.uid=JSONUtils.getLong(json, "uid");
		this.tagname=JSONUtils.getString(json, "tagname");
		this.tagid=JSONUtils.getInt(json, "tagid");
	}
	
	public String getGroupname() {
		if(groupname==null)groupname ="";
		return groupname;
	}

	public void setGroupname(String groupname) {
		this.groupname = groupname;
	}

	public long getUid() {
		return uid;
	}
	public void setUid(long uid) {
		this.uid = uid;
	}
	public int getTagid() {
		return tagid;
	}
	public void setTagid(int tigid) {
		this.tagid = tigid;
	}
	public String getTagname() {
		return tagname;
	}
	public void setTagname(String tagname) {
		this.tagname = tagname;
	}
	
	@Override
	public String toString() {
		return tagname;
	}

	@Override
	public boolean equals(Object o) {
		if(o instanceof TagInfo){
			TagInfo tag = (TagInfo)o;
			if(tag.getTagid()==this.tagid){
				return true;
			}
		}
		return false;
	}

	@Override
	public int hashCode() {
		return 0;
	}	
	
}
